package com.lk;

import com.lk.config.SpringConfig;
import com.lk.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {


    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        BookDao bookDao = ctx.getBean(BookDao.class);
//        bookDao.save();
        bookDao.update(); // 测试aop

        //Aop的本质：代理模式
        //如果切入点匹配了bookDao中的方法，则代理模式生效,为代理对象
        //否则就是原始对象
        System.out.println(bookDao);
        System.out.println(bookDao.getClass());
    }
}